home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / test_tick.c < prev    next >
C/C++ Source or Header  |  1994-07-11  |  402b  |  23 lines

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <sys/times.h>
  4.  
  5. /*
  6.  * Use this program to determine the proper value of MSPTICK for
  7.  * your system.
  8.  */
  9. main() {
  10.     long old, curr, times();
  11.     struct tms foo;
  12.     float f;
  13.  
  14.     old = times(&foo);
  15.     for (;;) {
  16.         sleep(1);
  17.         curr = times(&foo);
  18.         f = 1000.0/(float)(curr - old);
  19.         printf("actual value = %f, MSPTICK = %d\n", f, (int)(f + 0.5));
  20.         old = curr;
  21.     }
  22. }
  23.